<script type="text/javascript">

	function validateForm(){
		var form = document.forms[0]; 
		if (form.idTemplate.value == "")
			alert('Debe seleccionar un template');	
		else if (form.idSitePages.value == "")
			alert('Debe seleccionar una pagina');	
		else if (form.idUsers.value == "")
			alert('Debe seleccionar un usuario');					
		else
			form.submit();
	} 

	function cancelar() {
		window.location.href='<%=request.getContextPath() %>/asignTemplateList.do';
	} 
</script>


<tr>	
	<td>Template:</td>
	<td>
		<logic:notEmpty name="asignTemplateEditForm" property="idTemplate">
			<b><bean:write name="asignTemplateEditForm" property="asignTemplate.name"/></b>
		</logic:notEmpty>
		<logic:empty name="asignTemplateEditForm" property="idTemplate">
			<html:select property="idTemplate">
						<option value="">Seleccione...</option>
						<html:optionsCollection name="asignTemplateEditForm" property="templates" value="id" label="name"/> 
			</html:select>
		</logic:empty>

	</td>
</tr>

<tr>	
	<td>P&aacute;gina:</td>
	<td>
		<select name="idSitePages">
			<option value="">Seleccione...</option>
			<logic:notEmpty name="asignTemplateEditForm" property="webSites">
				<logic:iterate name="asignTemplateEditForm" property="webSites" id="webSite">
					<logic:notEmpty name="webSite" property="sitePages">
						<logic:iterate name="webSite" property="sitePages" id="sitePage">
							<logic:notEmpty name="asignTemplateEditForm" property="idSitePages">
							<option selected value="<bean:write name="sitePage" property="id" />">
								<bean:write name="sitePage" property="name" /> - <bean:write name="webSite" property="name" />
							</option>
							</logic:notEmpty>
							<logic:empty name="asignTemplateEditForm" property="idSitePages">
							<option value="<bean:write name="sitePage" property="id" />">
								<bean:write name="sitePage" property="name" /> - <bean:write name="webSite" property="name" />
							</option>
							</logic:empty>
						</logic:iterate>
					</logic:notEmpty>
				</logic:iterate>
			</logic:notEmpty>
		</select>
	</td>
</tr>

<tr>	
	<td>Usuario responsable:</td>
	<td>
		<html:select property="idUsers">
					<option value="">Seleccione...</option>
					<html:optionsCollection name="asignTemplateEditForm" property="users" value="id" label="userName"/> 
		</html:select>

	</td>
</tr>




